<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{margin:0;padding:0;}
        table{width: 100%;}
        .border{border-collapse: collapse;width:100%;}
        .border td{border: 1px solid #000;height:40px;}
        .text-center{text-align: center;}
        .text-right{text-align: right;}
        .text-left{text-align: left;padding-left:2mm;}
        .text-bold{font-weight:900;}
        .line-hieght{padding:2mm 0;}
        .product td{text-align: center;}
        .border-bottom{border-bottom: #000 solid 1px;}
    </style>
</head>
<body>
<table class="header">
    <tr>
        <td colspan="3" class="text-left" style="height: 15mm;">
            采购单号: {$purchase.purchase_sn}
        </td>
        <td colspan="3" class="text-right" style="height: 15mm;">
            <img style="width: 80mm;" src="{$barcode}">
        </td>
    </tr>
    <tr>
        <td class="text-right" style="width: 10%;">采购员:</td>
        <td class="text-left border-bottom" style="width: 20%;">{$purchase.buyer.nickname}</td>
        <td class="text-right line-hieght"style="width: 10%;">下单时间:</td>
        <td class="text-left border-bottom" style="width: 20%;">{$purchase.business_date|substr=0,10}</td>
        <td class="text-right" style="width: 10%;">供应商:</td>
        <td class="text-left border-bottom" style="width: 30%;">{$purchase.producer_name}</td>
    </tr>
    <tr>
        <td class="text-right line-hieght">调入仓库:</td>
        <td class="text-left border-bottom">{$purchase.warehouse.name}</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
</table>
<table class="border product" style="margin-top: 10mm;">
    <thead>
    <tr>
        <td class="text-bold">图片</td>
        <td class="text-bold">SKU</td>
        <td class="text-bold">数量</td>
        <td class="text-bold">单价</td>
        <td class="text-bold">备注</td>
    </tr>
    </thead>
    <tbody>
    {foreach $purchase->info as $info}
    <tr>
        <td style="width: 33mm; padding: 2mm;">
            <img style="width: 30mm;" src="{$info.image_url}">
        </td>
        <td>{$info.sku}</td>
        <td>{$info.qty}</td>
        <td>{$info.price|abs}</td>
        <td></td>
    </tr>
    {/foreach}
    </tbody>
</table>
</body>
</html>